//
// Created by zhengjuping on 24-9-12.
//

#ifndef ENV_II_BT_ENVIIGATTCHARACTERISTICDESC_H
#define ENV_II_BT_ENVIIGATTCHARACTERISTICDESC_H
#include "GattCharacteristic.h"

class ICharacteristicNotifyObserver {
public:
    virtual ~ICharacteristicNotifyObserver() = default;
    virtual void onNotify(bool enable) = 0;
};

class EnvIIGattCharacteristicDesc : public GattCharacteristic {
public:
    EnvIIGattCharacteristicDesc();
    ~EnvIIGattCharacteristicDesc() override = default;

    void setNotifyObserver(const std::shared_ptr<ICharacteristicNotifyObserver>& observer);
private:
    void onWriteEvent(const uint8_t *data, uint16_t length ) override;

    std::weak_ptr<ICharacteristicNotifyObserver> _observer;
};


#endif //ENV_II_BT_ENVIIGATTCHARACTERISTICDESC_H
